package com.ns002.yigou.quote.service;

import com.ns002.yigou.quote.dao.RealTimeQuoteDao;
import com.ns002.yigou.quote.dao.impl.SqlExecuteDao;
import com.ns002.yigou.quote.entity.RealTimeQuote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Calendar;
import java.util.Date;


/**
 * @Author xu
 * @Date 2017/7/26 0026 下午 9:42
 * 实时行情业务逻辑
 */
@Service
public class RealTimeQuoteService {

    @Autowired
    RealTimeQuoteDao realTimeQuoteDao;
    @Autowired
    SqlExecuteDao sqlExecuteDao;

    /**
     * 查询某个行情最后的行情点时间
     * @return
     */
    public RealTimeQuote findLast(String contract){
        return realTimeQuoteDao.findLast(contract);
    }

    /**
     * 保存数据
     * @param t
     * @return
     */
    @Transactional
    public void save(RealTimeQuote t){
        sqlExecuteDao.saveRealTimeQuote(t);
    }

}
